<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #alarmLamp{
            width: 200px;
            height: 300px;
            background-color: red;
            border-radius:40% 40% 10% 10%;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
        }
        #lamp{
            width: 300px;
            height: 300px;
            animation-name: imageAnim;
            animation-duration: 0.5s;
            animation-iteration-count: infinite;
            animation-direction: alternate;
            animation-timing-function: ease;
            animation-play-state: running;
            background-image: radial-gradient(yellow,red);
        }
        @keyframes imageAnim{
            0% {opacity: 0.9;}
            50% {opacity: 0.5;}
            100% {opacity: 0;}
        }
    </style>
  </head>
  <body>
    <div id="alarmLamp">
      <div id="lamp"></div>
    </div>
  </body>
  <script>
    var str =
      "https://ryximages.ryx365.com/6f1ac129-74e4-49a1-a9b2-39c6a5804423.jpg?imageView2/1/w/530/h/324/q/100";
    // var str = "https://saas-2-ryx.oss-cn-guangzhou.aliyuncs.com/1522186891129004033/ac785a301a4e4d03a12f3d6cfe0812bf.jpg?imageView2/1/w/530/h/324/q/100";
    var reg = RegExp(/ryximages.ryx365.com/);
    console.log(str.match(RegExp(/ryximages.ryx365.com/)));
    console.log(
      str.match(RegExp(/ryximages.ryx365.com/))
        ? "?imageView2/1/w/530/h/324/q/100"
        : "?x-oss-process=image/resize,m_fill,h_324,w_530"
    );

    let t = "Widget with id";
    console.log(str.indexOf("ryximages.ryx365.com"));

    let type = "task";
    console.log(type === "exam" ? 2 : type !== "course" ? 1 : 3);

    let arr = {
      list: [
        {
          paa: [
            {
              a: 1,
            },
            {
              a: 2,
            },
          ],
        },
        {
          paa: [
            {
              a:  3 ,
            },
            {
              a:  4 ,
            },
          ],
        },
      ],
    };
    console.log(arr);
    let i = 2;
    arr.list.map((item, index) => {
      item.paa.map((item2,index2)=>{
        if(item2.a == i){
          console.log(item.paa[index2- 1]);
        }
        
      })
    });
  </script>
</html>
